import { Switch, Route } from 'react-router-dom';

import React, { Component } from 'react';
import Home from '../pages/Home/Home';
import Users from '../pages/Users/Users';
import Roles from '../pages/Roles/Roles';

// Products
import Categories from '../pages/Products/Categories/Categories';
import ProductsList from '../pages/Products/ProductsList/ProductsList';
import AddProduct from '../pages/Products/ProductsList/AddProduct';
import UpdateProducts from '../pages/Products/ProductsList/UpdateProduct';

// Finances
import Transaction from '../pages/Finances/Transaction/Transaction';
import SalesPerformance from '../pages/Finances/SalesPerformance/SalesPerformance';

export default class HomeRouter extends Component {
  render() {
    return (
      <Switch>
        <Route path="/home" component={Home}></Route>
        <Route path="/users" component={Users}></Route>
        <Route path="/roles" component={Roles}></Route>
        {/* 商品管理 */}
        <Route path="/products/categories" component={Categories}></Route>
        <Route path="/products/products-list" component={ProductsList}></Route>
        <Route path="/products/add" component={AddProduct}></Route>
        <Route path="/products/update/:id" component={UpdateProducts}></Route>

        {/* 财务管理 */}
        <Route path="/finances/transaction" component={Transaction}></Route>
        <Route
          path="/finances/sales-performance"
          component={SalesPerformance}
        ></Route>
      </Switch>
    );
  }
}
